// 环境判断
const isDevelopment = process.env.NODE_ENV === 'development';

// API基础地址配置
const BASE_URL = isDevelopment 
  ? 'http://localhost:3000'
  : window.location.origin; // 替换为实际的生产环境域名

// 获取完整的API URL
export const getApiUrl = (path) => `${BASE_URL}${path}`;

const config = {
  baseUrl: BASE_URL,
  isDev: isDevelopment,
  getApiUrl
};

export default config;